#define UART0_TX_Data *((volatile unsigned int *)0x40000020)
#define UART0_TX_Send *((volatile unsigned int *)0x40000024)

unsigned int gCount;

void setup() {
  // put your setup code here, to run once:
  gCount = 0;
}


void loop() {
  // put your main code here, to run repeatedly:
  unsigned int i;

  //change led state
  asm volatile(
    "addi x16,x16,1;"
  );
  
  //invoke uart0 tx
  gCount ++;
  UART0_TX_Data = gCount;
  UART0_TX_Send = 1;

  //delay
  for (i=0;i<10;i++) {
    asm volatile(
      "nop;"
    );
  }
  

}
